GBML manual / Backgrounds

zoom_background_palette

Draws the room’s zoomable background in the colors of a palette instead of the colors of its picture. zoom_background_palette(nothing) puts the picture’s own colors back.

Game Boy: not available

Game Boy Color: not available

Sega Genesis: not available

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

zoom_background_palette(palette)

Arguments

NameType
palettepalette

Returns

Nothing.

Description

Draws the room's zoomable background in the colors of a palette instead of the colors of its picture. zoom_background_palette(nothing) puts the picture's own colors back. It does nothing in a room that has no zoomable background.

The palette has to have 256 colors, because the zoomable picture is the 8-bit kind. A palette made for sprites and tiles has 16, and the build tells you if you give one here.

The console keeps ONE set of 256 colors for every 8-bit picture on the screen. So a swap recolors all of them at once. That only matters if you also have another 8-bit picture showing, which most games do not. The picture's own colors are put back by the engine as soon as the zoomable background goes away - you leave the room or restart it - so another room never starts in colors it did not choose.

Only the colors the picture uses are replaced. It uses every color number up to the highest one in its pixels, rounded up to a multiple of 16.

Example

// Create event of the object that runs the map screen
zoom_background_palette(pal_doc_world);

The map is drawn in the colors of pal_doc_world. Leave the room and the map's own colors come back by themselves.

On the GBA

A no-op in a room that has no zoomable background. The palette has to have 256 colors, because the zoomable picture is the 8-bit kind (a palette made for sprites and tiles has 16). The console keeps ONE set of 256 colors for every 8-bit picture on the screen, so a swap recolors all of them at once; that is only a problem if you also have another 8-bit background showing, which most games do not. The picture’s own colors are put back by the engine as soon as the zoomable background goes away (you leave the room, or restart it), so another room never starts in colors it did not choose. Only the colors the picture uses are replaced (it uses every color up to the highest color number in its pixels, rounded up to a multiple of 16).

See also: Palettes - recoloring a pictureZoomable backgroundszoom_background_positionbackground_palettetile_layer_palettesprite_palette